package com.xiaoxin_project.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xiaoxin_project.Util.FastDFSClient;
import com.xiaoxin_project.Util.FileUtils;
import com.xiaoxin_project.Util.QRCodeUtils;
import com.xiaoxin_project.enums.SearchFriendsStatusEnum;
import com.xiaoxin_project.mapper.MyFriendsMapper;
import com.xiaoxin_project.mapper.UserMapper;
import com.xiaoxin_project.pojo.MyFriends;
import com.xiaoxin_project.pojo.Users;
import com.xiaoxin_project.service.FriendService;
import com.xiaoxin_project.service.UserService;
import org.n3r.idworker.Sid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

@Service
public class FriendServiceImpl implements FriendService {

    @Autowired
    private UserMapper userMapper;

    @Autowired
    private Sid sid;

    @Autowired
    private MyFriendsMapper myFriendsMapper;


    /**
     *添加好友
     */
    @Override
    public boolean addFriends(String myUserId, String friendId) {
        String Ids = sid.nextShort();

        MyFriends myFriends = new MyFriends();
        myFriends.setId(Ids);
        myFriends.setMyUserId(myUserId);
        myFriends.setFriendId(friendId);
        myFriendsMapper.insert(myFriends);

        return true;
    }
}
